package com.hejjon.graph.controller;

import com.alibaba.fastjson.JSONObject;
import com.hejjon.graph.config.Neo4jConfig;
import com.hejjon.graph.service.Neo4jQueryService;
import org.neo4j.driver.types.Node;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import org.neo4j.driver.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;


/**
 * @author: cs
 * @date: 2025-04-27 22:03:04
 * @since: 1.0
 */
@RequestMapping("/graph")
@RestController
public class GraphController {

    @Resource
    private Neo4jQueryService queryService;

    @GetMapping("/demo")
    public Map<String, Object> demo() {
        return queryService.query("MATCH (n) RETURN n LIMIT 25;");
    }

}
